/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package baitap;

import java.util.Scanner;

/**
 *
 * @author Nhim
 */
public class Bai1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        long n = input.nextInt();
        if(Ngto(n) == true) System.out.println("YES");
        else System.out.println("NO");
    }
    public static boolean Ngto(long n){
        if(n < 2) return false;
        for(long i = 2; i <= Math.sqrt(n); i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
